﻿using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
/*扩展编辑器*/
public class My_Window : EditorWindow//继承自编辑器窗口
{
    [MenuItem("Tools/MyWindow")]
    public static void OpenWindow() 
    {
        EditorWindow.GetWindow<My_Window>();
    }
    private void OnGUI()
    {
        if (GUILayout.Button("创建一个方块")) 
        {
            GameObject.CreatePrimitive(PrimitiveType.Cube);
        }
    }
}
